<?php
/**
 * @CopyRight  (C)2006-2011 OE Development team Inc.
 * @WebSite    www.phpcoo.com，www.oecms.cn
 * @Author     XiangFeng <phpzac@foxmail.com>
 * @Brief      OEcms v3.x
 * @Update     2011.09.01
 * Id          自定义HTML页面
**/
if(!defined('ALLOWGUEST')) {
	exit('Access Denied');
}
$id = Core_Fun::rec_post("rid");
if(!Core_Fun::isnumber($id)){
	Core_Fun::halt("对不起，ID不存在或已删除！","",1);
}

$posArray = array(
1=>"选择吉日",
2=>"开运宝物",
3=>"预约专家现场堪舆",
4=>"专家在线看风水",
5=>"专家起名改名",
6=>"预约专家测八字",
7=>"专家测八字",
8=>"购买开运宝物",
365=>"购买356",
9=>"参加活动",
);

$msg = array();
$msg['desc']='';
$msg['date'] = date("Y-m-d");
$msg['title'] = $posArray[$id];
$msg['titledata'] = "[Banner]我要".$msg['title'];
$msg['rid']	= $id;
$msg['url'] =  Core_Fun::rec_post('url');


switch($id){
case 365:
	header("Location:/case");
break;
case 2:
	header("Location:/product");
break;
case 8:
{
	$pid = Core_Fun::rec_post('pid');
	if(!Core_Fun::ischar($pid)) 
		break;
	$sql	= "SELECT * FROM ".DB_PREFIX."product WHERE `productid` = ".$pid;
	$product = $db->fetch_first($sql);
	if($product){
		
		$msg['desc']= "我要购买：".$product['productname']."。";
		$msg['titledata'] = "[购买宝物]".$product['productname']."[编号]".$product['productnum'];
	}
	else
	{
		Core_Fun::halt("该宝物不存在！","",1);
	}
	
}
break;

default:
break;
}

$msg['titledata'] .= "(".$msg['date'].")";

//添加留言

//check user login

/*
if(!$page){
	Core_Fun::halt("对不起，页面不存在或已删除！","",1);
}else{

}
*/

//$tpl->assign("url_".$page_title,$page['url']);

//$tpl->assign("id",$id);
$tpl->assign("msg",$msg);

?>